Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xds: refactor ADS related data to xDS-Manager part 1 #38145

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

adisuissa
Copy link
Contributor

Commit Message: xds: refactor ADS related data to xDS-Manager part 1
Additional Description:
As part of the work on #24773 the xDS-related functionality needs to be moved from the cluster-manager to the xDS-manager.
This is the first refactor: moving the xDS-manager initialization to the end of the cluster-manager's c'tor.

Risk Level: low
Testing: Updated tests.
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #38145 was opened by adisuissa.

see: more, trace.

@adisuissa adisuissa marked this pull request as ready for review January 23, 2025 13:41
@adisuissa
Copy link
Contributor Author

/assign @nezdolik

* @param cm - a pointer to a valid cluster manager.
* @return Ok if the initialization was successful, or an error otherwise.
*/
virtual absl::Status initialize(Upstream::ClusterManager* cm) PURE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the param be a reference type instead? E.g. this way the api would imply you can only use it with a valid cm instance

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to passing a reference instead of pointer (if it makes sense).
Nevertheless, the XdsManagerImpl class will need to hold a pointer to the cluster-manager and not a reference, as the xds-manager is instantiated before the cluster-manager.
LMK if you still think we should have this argument to a reference, and if so, I'll make the change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in that case everything looks good, i was under impression that cm is constructed before the xds manager.


// Config::ConfigSourceProvider
absl::Status initialize(Upstream::ClusterManager* cm) override;
void shutdown() override {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this be implemented later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this will shutdown the ADS once ads_mux_ is moved from the cluster-manager to the xds-manager (see here.
The reason I'm introducing the method at this stage is to reduce the amount of changes in the next refactors (smaller PRs).

Copy link
Contributor Author

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comments @nezdolik !


// Config::ConfigSourceProvider
absl::Status initialize(Upstream::ClusterManager* cm) override;
void shutdown() override {}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this will shutdown the ADS once ads_mux_ is moved from the cluster-manager to the xds-manager (see here.
The reason I'm introducing the method at this stage is to reduce the amount of changes in the next refactors (smaller PRs).

* @param cm - a pointer to a valid cluster manager.
* @return Ok if the initialization was successful, or an error otherwise.
*/
virtual absl::Status initialize(Upstream::ClusterManager* cm) PURE;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to passing a reference instead of pointer (if it makes sense).
Nevertheless, the XdsManagerImpl class will need to hold a pointer to the cluster-manager and not a reference, as the xds-manager is instantiated before the cluster-manager.
LMK if you still think we should have this argument to a reference, and if so, I'll make the change.

@adisuissa
Copy link
Contributor Author

/assign-from @envoyproxy/senior-maintainers

Copy link

@envoyproxy/senior-maintainers assignee is @RyanTheOptimist

🐱

Caused by: a #38145 (comment) was created by @adisuissa.

see: more, trace.

@RyanTheOptimist RyanTheOptimist merged commit 3bfcddb into envoyproxy:main Jan 28, 2025
25 checks passed
bazmurphy pushed a commit to bazmurphy/envoy that referenced this pull request Jan 29, 2025
Commit Message: xds: refactor ADS related data to xDS-Manager part 1
Additional Description:
As part of the work on envoyproxy#24773 the xDS-related functionality needs to be
moved from the cluster-manager to the xDS-manager.
This is the first refactor: moving the xDS-manager initialization to the
end of the cluster-manager's c'tor.

Risk Level: low
Testing: Updated tests.
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Adi Suissa-Peleg <[email protected]>
mum4k added a commit to mum4k/nighthawk that referenced this pull request Feb 3, 2025
- synced changes to `.bazelrc`, `.bazelversion`,
  `tools/code_format/config.yaml` from Envoy's version.
- no changes in `run_envoy_docker.sh`, `tools/gen_compilation_database.py`.
- added an instance of `Envoy::Config::XdsManager&` onto the
  `NighthawkServerFactoryContext`, since the `ClusterManager` constructor now
  calls this new method unconditionally. Nothing in Nighthawk will use the
  `Envoy::Config::XdsManager&` instance. This is due to
  envoyproxy/envoy#38145.

Signed-off-by: Jakub Sobon <[email protected]>
fei-deng pushed a commit to envoyproxy/nighthawk that referenced this pull request Feb 4, 2025
- synced changes to `.bazelrc`, `.bazelversion`, `tools/code_format/config.yaml` from Envoy's version.
- no changes in `run_envoy_docker.sh`, `tools/gen_compilation_database.py`.
- added an instance of `Envoy::Config::XdsManager&` onto the `NighthawkServerFactoryContext`, since the `ClusterManager` constructor now calls this new method unconditionally. Nothing in Nighthawk will use the `Envoy::Config::XdsManager&` instance. This is due to envoyproxy/envoy#38145.
- tune the open loop mini stress test whjich started being flaky under `test_gcc`. Ideally we shouldn't be running stress test on CI at all, but leaving it in as long as it is able to pass.
- no update needed in `tools/base/requirements.in`.

Signed-off-by: Jakub Sobon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants